<template>
	<view>
		<form action="">
			<view class="name">
				<view class="n-name">
					姓名:
				</view>
				<input class="n-inp" type="text"  v-model="name">
			</view>
			<view class="name">
				<view class="n-name">
					年级科目:{{this.class}}{{this.science}}
				</view>
			</view>
			<view class="name">
				<view class="n-name">
					您的性别:{{this.sex}}
				</view>
			</view>
			<view class="name">
				<view class="n-name">
					您的学校:
				</view>
				<input class="n-inp" type="text" v-model="school" >
			</view>
			<view class="name">
				<view class="n-name">
					您的联系方式:
				</view>
				<input class="n-inp" type="text"  v-model="tel">
			</view>
			
		</form>
		<button @click="submittecform">接收此单</button>
	</view>
</template>

<script>
	import $http from '@/common/api/request.js'
	export default{
		data(){
			return{
				time:"",uu_id:"",
				class:'',
				science:"",
				sex:"",
				tel:"",
				name:"",
				school:"",
				rules: {
					tel: {
						rule: /^1[3456789]\d{9}$/,
						msg: "电话号码格式错误"
					}
					}
			}
		},
		methods:{
			submittecform(){
				$http.request({
					url: "/submittecform",
					method:"POST",
					header:{
						token:true
					},
					data:{
						school:this.school,
						tec_name:this.name,
						tec_tel:this.tel,
						time :this.time,
						uu_id : this.uu_id
					}
				}).then((res) => {
					uni.showToast({
						title: "接单成功,注意及时联系学员"
					})
					uni.navigateTo({
						url:'/pages/jieqia/jieqia'
					})
				}).catch(() => {
					uni.showToast({
						title: "接口错误"
					})
				})
			}
		},
		onLoad(e) {
			this.class = e.class;
			this.science = e.science;
			this.sex = e.sex;
			this.time = e.time;
			this.uu_id = e.uu_id
		}
	}
</script>
<style lang="scss">
	.name
		{
		display: flex;
		border-bottom: 1rpx solid #15aeff;
	
		.n-name {
			font-size: 30rpx;
			padding: 20rpx;
			margin-right: 20rpx;
		}
	
		.n-inp {
	
			height: 68rpx;
			width: 60%;
		}
	}
	
</style>